package com.bss.model;

// Generated Oct 27, 2011 10:37:49 PM by Hibernate Tools 3.3.0.GA

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.andy.basics.AbstractEntity;

@Entity
@Table(name = "materialsetmapping")
public class MaterialSetMapping extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8633357087668449861L;

	private int id;

	private MaterialSet materialSet = new MaterialSet();

	private MaterialType materialType = new MaterialType();

	private int instances;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "idMaterialSet")
	public MaterialSet getMaterialSet() {
		return this.materialSet;
	}

	public void setMaterialSet(final MaterialSet materialSet) {
		this.materialSet = materialSet;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "idMaterialType")
	public MaterialType getMaterialType() {
		return this.materialType;
	}

	public void setMaterialType(final MaterialType materialType) {
		this.materialType = materialType;
	}

	@Column(name = "instances")
	public int getInstances() {
		return this.instances;
	}

	public void setInstances(final int instances) {
		this.instances = instances;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(final int id) {
		this.id = id;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 19)
	public Date getDate() {
		return this.date;
	}
}
